package org.review.algorithm.sort;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class Sort {
    static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SS");

    public static void showTime() {
        System.out.println(sdf.format(new Date()));
    }

    public static int[] initArray(int size) {
        int[] arr = new int[size];

        for (int i = 0; i < arr.length; i++) {
            arr[i] = new Random().nextInt(size * 5);
        }

        return arr;
    }

    public static void showArray(int[] arr) {
        for (int i : arr) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    public static void swap(int[] arr, int i, int j) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }

}
